package com.culturalCenter.dataCenter.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author : weicai
 * @date : 9:35 2020/9/25
 */
@Getter
public enum StatusEnum {

    TRAILER(0, "预告中"),
    SIGNINGUP(1, "报名中"),
    PROCESSING(2, "进行中"),
    OVER(3, "已结束");

    private Integer statusId;
    private String status;

    StatusEnum(int statusId, String status) {
        this.statusId = statusId;
        this.status = status;
    }

    public static Integer getStatusId(String status) {
        StatusEnum[] statusEnums = StatusEnum.values();
        for (StatusEnum statusEnum : statusEnums) {
            if (Objects.equals(statusEnum.status, status)) {
                return statusEnum.statusId;
            }
        }
        return null;
    }

}
